import request from '@/utils/request'

// 创建房屋折扣
export function createDiscounts(data) {
  return request({
    url: '/system/discounts/create',
    method: 'post',
    data: data
  })
}

// 更新房屋折扣
export function updateDiscounts(data) {
  return request({
    url: '/system/discounts/update',
    method: 'put',
    data: data
  })
}

// 删除房屋折扣
export function deleteDiscounts(id) {
  return request({
    url: '/system/discounts/delete?id=' + id,
    method: 'delete'
  })
}

// 获得房屋折扣
export function getDiscounts(id) {
  return request({
    url: '/system/discounts/get?id=' + id,
    method: 'get'
  })
}

// 获得房屋折扣分页
export function getDiscountsPage(params) {
  return request({
    url: '/system/discounts/search',
    method: 'get',
    params
  })
}
// 导出房屋折扣 Excel
export function exportDiscountsExcel(params) {
  return request({
    url: '/system/discounts/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
